//
// Created by Administrator on 2023/7/31.
//
#include <iostream>
#include <vector>
#include <unordered_map>

using namespace std;

class Solution {
public:
    vector<int> numberOfPairs(vector<int> &nums) {
        unordered_map<int, int> appearance;
        for (auto &x: nums) {
            appearance[x]++;
        }
        int count = 0;
        for (auto &x: appearance) {
            if (x.second % 2 == 1) {
                count++;
            }
        }
        return vector<int>{int(nums.size() - count) / 2, count};
    }
};

int main() {
    vector<int> nums{1, 3, 2, 1, 3, 2, 2};
    Solution s;
    auto ans = s.numberOfPairs(nums);
    for (auto &x: ans) cout << x << endl;

}